<form id="form_produk_user" method="post" enctype="multipart/form-data">
<input type="hidden" name="sts" id="sts" value="<?=$sts?>"/>
<input type="hidden" name="id" id="id" value="<? if($sts=='edit')echo $data->id; else echo '';?>"/>

<div style="margin-right:5px;">
	<fieldset>
	<legend>Produk Deskripsi</legend>
	<label>Nama Produk</label> : <input type="text" name="nama_produk" id="nama_produk" style="width:200px;" class="easyui-validatebox text_na" 
	value="<? if($sts=='edit')echo $data->nama_produk; else echo '';?>"  /><br /><br />
	<label>Deskripsi Produk</label> <span style=" vertical-align:top">:</span> <textarea name="deskripsi" class="easyui-validatebox text_na" id="deskripsi"><? if($sts=='edit')echo $data->deskripsi; else echo '';?></textarea><br /><br />
	<label>Harga</label> : <input type="text" name="harga" id="harga" style="width:100px;" value="<? if($sts=='edit')echo $data->harga_na; else echo '';?>" class="easyui-validatebox text_na" /> (min 89,000)<br /><br />
	<label>Warna</label> : <select name="cl_warna_id" id="cl_warna_id" class="easyui-validatebox text_na" /></select><br /><br />
	<label>Kategori</label> : <select name="cl_kategori_id" id="cl_kategori_id" class="easyui-validatebox text_na" /></select><br /><br />
	</fieldset>
</div>
<div>
	<fieldset>
	<legend>Produk Foto</legend>
	<label>Gambar Produk 1</label> : <input type="file" name="foto_1" id="foto_1" style="width:200px;" class="text_na <? if($sts=='add')echo 'easyui-validatebox'; else echo '';?>" onChange="cek_size(this,235,240,100)" /> 
	<span style="margin-left:70px;">(234x238 max 100kb)</span><br>
	<label>Gambar Produk 2</label> : <input type="file" name="foto_2" id="foto_2" style="width:200px;" class="text_na <? if($sts=='add')echo 'easyui-validatebox'; else echo '';?>" onChange="cek_size(this,235,240,100)" /> 
	<span style="margin-left:70px;">(234x238 max 100kb)</span><br>
	<label>Gambar Produk 3</label> : <input type="file" name="foto_3" id="foto_3" style="width:200px;" class="text_na <? if($sts=='add')echo 'easyui-validatebox'; else echo '';?>" onChange="cek_size(this,129,146,100)" />
	<span style="margin-left:70px;">(128x146 max 100kb)</span><br>
	<br><br>
	<div align="center" >
	<img src="<?=base_url()?>repositori/produk_user/<?=$foto_1?>" id="gambar_1" height="100" width="100" class="gambar_kecil">
	<img src="<?=base_url()?>repositori/produk_user/<?=$foto_2?>" id="gambar_2" height="100" width="100" class="gambar_kecil">
	<img src="<?=base_url()?>repositori/produk_user/<?=$foto_3?>" id="gambar_3" height="100" width="100" class="gambar_kecil">
	<br><br />
	<div style="margin-top:3px;"><a id="simpan" href="#" style="float:right;">Simpan Semua Data</a></div>
	</div><br />
	</fieldset>
</div>
</form>

<script>

$(".easyui-validatebox").validatebox({required:true } );
$(".easyui-validatemail").validatebox({required:true,validType:'email'}); 
sts_form="produk_user";
var sts='<?=$sts?>';
var cl_warna='<? if($sts=='edit')echo $data->cl_warna_id; else echo '';?>'
var cl_kategori='<? if($sts=='edit')echo $data->cl_kategori_id; else echo '';?>'

var url_img1='<?=base_url()?>repositori/produk_user/<?=$foto_1?>';
var url_img2='<?=base_url()?>repositori/produk_user/<?=$foto_2?>';
var url_img3='<?=base_url()?>repositori/produk_user/<?=$foto_3?>';

$('#gambar_1').attr("src",url_img1+'?timestamp='+ new Date().getTime());
$('#gambar_2').attr("src",url_img2+'?timestamp='+ new Date().getTime());
$('#gambar_3').attr("src",url_img3+'?timestamp='+ new Date().getTime());

</script>
<script type="text/javascript" src="<?=base_url()?>assets/js/data/backend/form.js"></script>
